import HttpRequest from './api.request'

// 登录接口
export const login = (params) => HttpRequest.postJson('/user/login',params)

// 菜单接口
export const menus = () => HttpRequest.get('/user/current/menus')

/**应用 start */
export const appList = () => HttpRequest.get('/control/app/list')
export const appUsed = (id,used) => HttpRequest.get('/app/change/'+id+"/"+used)
export const appDetail = (id) => HttpRequest.get('/app/detail/'+id)
export const appRoles = (id) => HttpRequest.get('/app/roles/'+id)
export const appMenus = (id) => HttpRequest.get('/control/app/menus/'+id)
export const appAddResource = (params) => HttpRequest.postJson('/control/app/add/resource',params)
export const appDeleResource = (id) => HttpRequest.get('/control/app/dele/resource/'+id)
export const appRoleBindedResource = (id) => HttpRequest.get('/role/binded/resource/'+id)
export const appBindsResource = (params) => HttpRequest.postJson('/role/binds/resource',params)
export const userBindRoles = (params) => HttpRequest.postJson('/role/binds/user',params)
export const getAppRoles = (companyUserId) => HttpRequest.get('/role/apps/'+companyUserId)

/**应用 end */

/** 企业管理 start */
export const companySearch = (params) => HttpRequest.postJson('/company/search',params)
export const companyForm = (params) => HttpRequest.postFormData('/company/add',params)
export const companyLoad = (id) => HttpRequest.get('/company/load/'+id)
export const companyAppmenu = (id) => HttpRequest.get('/company/load/appmenus/'+id)
export const companySetAppmenu = (params) => HttpRequest.postJson('/company/set/appmenus',params)
export const companyHasApp = (id) => HttpRequest.get('/company/apps/'+id)
/** 企业管理 end */

/** =================================种植开始============================================ */
export const testLoad = () => HttpRequest.get('/test/load/4028f5a1727e2cde01727e4f18de0000',"plant")

export const farmAdd = (params) => HttpRequest.postJson('/plant/farm/add',params,"plant")
export const farmLoad = (id) => HttpRequest.get('/plant/farm/load/'+id,"plant")
export const farmSearch = (params) => HttpRequest.postJson('/plant/farm/search',params,"plant")
export const farmList = () => HttpRequest.get('/plant/farm/list',"plant")
export const plantAdd = (params) => HttpRequest.postFormData('/plant/plant/add',params,"plant")
export const plantLoad = (id) => HttpRequest.get('/plant/plant/load/'+id,"plant")
export const plantSearch = (params) => HttpRequest.postJson('/plant/plant/search',params,"plant")

/** =================================种植结束============================================ */
